const tokenKey = 'auth-token';
const userInfoKey = 'user-info'
const userIdKey = 'user-id'
const shiroTokenKey = 'auth-shiro-token'
const mobileKey = 'mobile'
export function getToken() {
    return uni.getStorageSync(tokenKey);
}

export function saveToken(token) {
	console.log('TOKEN',token)
    uni.setStorageSync(tokenKey, token);
}
export function saveMobile(mobile) {
    uni.setStorageSync(mobileKey, mobile);
}
export function saveShiroToken(shiroToken) {
    uni.setStorageSync(shiroTokenKey, shiroToken);
}
export function saveUserId(userId){
		uni.setStorageSync(userIdKey, userId);
}
export function getShiroToken() {
    return uni.getStorageSync(shiroTokenKey) || '';
}
export function getMobile() {
    return uni.getStorageSync(mobileKey);
}
export function getUserId(){
	return	uni.getStorageSync(userIdKey)||0;
}

export function removeToken() {
    uni.removeStorageSync(tokenKey);
	
}

export function getUsername() {
    return uni.getStorageSync('username');
}

export function saveUsername(username) {
    uni.setStorageSync('username', username);
}

export function removeUsername() {
    uni.removeStorageSync('username')
}

export function getUserInfoByStorage() {
    return uni.getStorageSync(userInfoKey) || {};
}

export function saveUserInfo(userInfo) {
    uni.setStorageSync(userInfoKey, userInfo);
}

export function removeUserInfo() {
    uni.removeStorageSync(userInfoKey)
	uni.removeStorageSync(userIdKey)
}

